<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    img {
        width: 100px;
    }
</style>

<body>


    <h1>结账</h1>

    <div class="box">

    </div>
</body>
<script src="https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js"></script>
<script>
    var obj = JSON.parse(sessionStorage.getItem("data"))

    function apply() {

        obj.forEach(item => {
            $('.box').append(`
              <br>
            <img src="${item.img}" alt="" class="aa" onclick="xq(${item.id})">
             <h4>${item.name}</h4>
            <h4>$${item.price}</h4>
             
            `)
        })

    }
    apply()
</script>

</html>